home *** CD-ROM | disk | FTP | other *** search
/ Visual FX for Image FX / VisualFX for Image FX 3.adf / Files / ARexx / 03 / 06.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1997-07-31  |  4.0 KB  |  225 lines

  1. /*
  2.                           Visual FX Arexx Script
  3.                            Written By J.L. White
  4.                          (C)1997 Merlin's Software
  5. */
  6.  
  7. Options Results
  8. address "IMAGEFX.1"
  9. ScreenToFront
  10. Undo Off
  11. if exists("libs:flyer.library") then do
  12.     TOASTERLIB="ToasterARexx.port"
  13.     call remlib('ToasterARexx.port')
  14.     call remlib('PROJECT_REXX_PORT')
  15.     call addlib('PROJECT_REXX_PORT' , 0)
  16.     call addlib(TOASTERLIB,0)
  17.     end
  18. call Settings()
  19. call open TempFile,"VFXIFX:TempDrawer/"FXNum".txt",R
  20. line = readln(TempFile)
  21. PicAName = strip(line)
  22. line = readln(TempFile)
  23. Start = strip(line)
  24. line = readln(TempFile)
  25. End = strip(line)
  26. line = readln(TempFile)
  27. IAType = strip(line)
  28. line = readln(TempFile)
  29. Type2 = strip(line)
  30. line = readln(TempFile)
  31. Feather = strip(line)
  32. line = readln(TempFile)
  33. WindowType = strip(line)
  34. call close TempFile
  35.  
  36. Frames = (End - Start)+1
  37. j=0
  38. k=0
  39. TFrames = Frames
  40. TNum = 3
  41. if TFrames > 999 then TNum = 4
  42. if TFrames > 9999 then TNum = 5
  43. if Field = 1 then TFrames = Frames*2
  44. do i = Start to End
  45.     k = k+ 1
  46.     call open TempFile,"RAM:VFXNums",W
  47.     call writeln TempFile,right(k,5,'0')
  48.     call writeln TempFile,right(Frames,5,'0')
  49.     call close TempFile
  50.     f=0
  51.     Redraw Off
  52.     j = j+ 1
  53.     FieldSet = 0
  54.     call DoIt()
  55.     Redraw On
  56.     call SaveIt()
  57.         if Field = 1 then do
  58.             Redraw Off
  59.             j = j + 1
  60.             FieldSet = 1
  61.             call DoIt()
  62.             Redraw On
  63.             call SaveIt()
  64.             end 
  65.     end
  66.     Undo On
  67. exit
  68.  
  69.  
  70.  
  71. LoadA:
  72.     if (POS('FLY_1',SHOW('Ports')) = 0) then do
  73.         Undo On
  74.         exit
  75.         end
  76.     if IAType = 0 then do
  77.         LoadBuffer PicAName Force i
  78.         if Field = 1 then do
  79.             GetMain
  80.             parse var result Name Width Height Blah
  81.             if FieldSet = 0 then do
  82.                 Hook DeInterlace
  83.                 Scale Width Height
  84.                 end
  85.             if FieldSet = 1 then do
  86.                 Hook DeInterlace
  87.                 Swap
  88.                 Scale Width Height
  89.                 end
  90.             end
  91.         end
  92.     if IAType = 1 then do
  93.         LoadBuffer PicAName Force 1
  94.         end
  95.     if IAType = 2 then do
  96.         LoadBuffer PicAName Force
  97.         end
  98.     if IAType = 3 then do
  99.         LoadBuffer PicAName""right(i,TNum,'0') Force
  100.         end
  101. return
  102.  
  103.  
  104. SaveIt:
  105.     if (POS('FLY_1',SHOW('Ports')) = 0) then do
  106.         Undo On
  107.         exit
  108.         end
  109.     if SaveType = 0 then do
  110.         call Switcher(TOSW)
  111.         call Switcher(MDV1)
  112.  
  113.         Render Go
  114.         if Field = 1 then
  115.                 call RecordAdd(SaveName,1,6,Compression)
  116.         else
  117.                 call RecordAdd(SaveName,2,6,Compression)
  118.         if j = TFrames then
  119.             call MakeIcon(SaveName,(Frames-10))
  120.         end
  121.  
  122.     if SaveType = 1 then do
  123.         if Field = 1 then do
  124.             f= f + 1
  125.             if f = 1 then
  126.                 SaveBufferAs ILBM "VFXIFX:TempDrawer/PicA"
  127.             if f = 2 then do
  128.                 GetMain
  129.                 parse var result Name Width Height Blah
  130.                 Scale Width Height/2
  131.                 Swap
  132.                 LoadBuffer "VFXIFX:TempDrawer/PicA" Force
  133.                 Scale Width Height/2
  134.                 Hook Interlace
  135.                 SaveBufferAs ILBM SaveName""right(k,TNum,'0')
  136.                 f = 0
  137.                 end
  138.             end
  139.         else do
  140.             SaveBufferAs ILBM SaveName""right(k,TNum,'0')
  141.             end    
  142.         end
  143.  
  144. return
  145.  
  146.  
  147. DoIt:
  148.     if (POS('FLY_1',SHOW('Ports')) = 0) then do
  149.         Undo On
  150.         exit
  151.         end
  152.     ActiveColor 1
  153.     DrawMode Normal
  154.     DrawStyle Normal
  155.     Pen 0 1
  156.     Blend 100
  157.     AlphaChannel Off
  158.     EdgeMode Normal 50
  159.     FillMode Solid 0 0 0 SMOOTH
  160.     AirbrushSettings 5 50 0 Spray
  161.  
  162.     call LoadA()
  163.     GetMain
  164.     parse var result Name Width Height Blah
  165.     Buffer2Swap
  166.     AlphaChannel Off
  167.     Buffer2Alpha
  168.     SwapAlpha
  169.     Clearbuffer Force 0 0 0
  170.     EdgeMode FeatherOut Feather
  171.     if WindowType = -1 then
  172.         FilledOval Width/2 Height/2 (Height/2)-10 (Height/2)-40
  173.     else
  174.         FilledOval WindowType
  175.     EdgeMode Normal
  176.     SwapAlpha
  177.     
  178.  
  179.     if Type2 = 0 then do
  180.         ColorToGrey 299 587 114
  181.         Grey2Color
  182.         end
  183.     if Type2 = 1 then do
  184.         ReliefMap 256 0
  185.         end
  186.     if Type2 = 2 then do
  187.         ColorToGrey 299 587 114
  188.         Grey2Color
  189.         Hook "Hooks/Sys/Antique"
  190.         end
  191.     if Type2 = 3 then do
  192.         Solarize
  193.         end
  194.     if Type2 = 4 then do
  195.         Negative
  196.         end
  197.     if Type2 = 5 then do
  198.         Posterize 3
  199.         end
  200.     if Type2 = 6 then do
  201.         FalseColor Standard
  202.         end
  203.     if Type2 = 7 then do
  204.         DrawMode Lighten
  205.         FilledBox 0 0 Width Height
  206.         FilledBox 0 0 Width Height
  207.         DrawMode Normal
  208.         end
  209.     if Type2 = 8 then do
  210.         DrawMode Darken
  211.         FilledBox 0 0 Width Height
  212.         FilledBox 0 0 Width Height
  213.         DrawMode Normal
  214.         end
  215.     if Type2 = 9 then do
  216.         Hook "Hooks/Sys/SobelEdge"  
  217.         end
  218.  
  219.     AlphaChannel FRISKET
  220.     Merge 100 Alpha
  221.     AlphaChannel Off
  222. return
  223.  
  224.  
  225.